﻿<UserControl x:Class="Citrix.XaAdminMobile.ViewCommon.ServerDetailsCommon"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:prop="clr-namespace:Citrix.XaAdminMobile.Properties"
             xmlns:res="clr-namespace:Citrix.XaAdminMobile.Resources"
             xmlns:u="clr-namespace:Citrix.XaAdminMobile.Util"
             FocusVisualStyle="{x:Null}"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="300">
  
  <!-- Shows the details of the server in a scroll viewer. This common control is reused in
  the specific tablet and phone server detail layouts, but with different toolbars. -->
  
  <ScrollViewer>
    <Grid>
      <Grid.RowDefinitions>
        <!-- Main server summary state -->
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <!-- XenApp install info -->
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <!-- OS info -->
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <!-- Licensing and zone -->
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <!-- Everything else -->
        <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>

      <!-- Main server summary state -->
      <Grid Margin="10">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="5"/>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- Server name -->
        <TextBlock Grid.ColumnSpan="3" Text="{Binding Name}"
                     FontSize="24"/>

        <!-- Session count -->
        <TextBlock
            Grid.Row="1" Text="{x:Static prop:Resources.ServerSessionCountLabel}"
            Foreground="Gray" FontSize="16"/>
        <TextBlock
            Grid.Row="1" Grid.Column="2" Text="{Binding SessionCount}"
            FontSize="16"/>

        <!-- Logons enabled state -->
        <TextBlock
            Grid.Row="2" Text="{x:Static prop:Resources.LogonsEnabledTag}"
            Foreground="Gray" FontSize="16"/>
        <TextBlock
            Grid.Row="2" Grid.Column="2" FontSize="16"
            Text="{Binding LogonsEnabled}"/>

        <!-- Logon mode -->
        <TextBlock
            Grid.Row="3" Text="{x:Static prop:Resources.LogonModeLabel}"
            Foreground="Gray" FontSize="16"/>
        <TextBlock
            Grid.Row="3" Grid.Column="2" FontSize="16"
            Text="{Binding LogonMode}"/>
        
        <!-- PCM mode -->
        <TextBlock
            Grid.Row="4" Text="{x:Static prop:Resources.PowerStateTag}"
            Foreground="Gray" FontSize="16"/>
        <TextBlock
            Grid.Row="4" Grid.Column="2"
            Text="{Binding PowerCapManagementMode}" FontSize="16"/>

        <!-- Load index -->
        <TextBlock
            Grid.Row="5" Grid.ColumnSpan="3" Text="{x:Static prop:Resources.ServerLoadIndexLabel}"
            Foreground="Gray" HorizontalAlignment="Right" FontSize="16"/>
        <TextBlock
            Grid.Row="5" Grid.Column="3" Text="{Binding Load}"
            HorizontalAlignment="Center" FontSize="16"/>

        <!-- Displays a bar graph of the load. -->
        <Border
            Grid.Column="3" Grid.RowSpan="5" CornerRadius="2" BorderThickness="2" BorderBrush="Gray"
            Width="60" Background="White">
          <Grid>
            <Grid.RowDefinitions>
              <RowDefinition Height="{Binding LoadUnusedHeight}"/>
              <RowDefinition Height="{Binding LoadUsedHeight}"/>
            </Grid.RowDefinitions>

            <!-- This border shows the load percentage. The height is controlled via bindings
              on the grid row dimensions. -->
            <Border Grid.Row="1" Background="LightBlue" CornerRadius="2"/>
          </Grid>
        </Border>

      </Grid>
      <Rectangle Grid.Row="1" Style="{DynamicResource RectangleSeparatorStyle}"/>

      <!-- XenApp install info -->
      <Grid Grid.Row="2" Margin="10">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="5"/>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- XenApp product name -->
        <TextBlock Grid.ColumnSpan="3" FontSize="20" Text="{Binding CitrixProductName}" TextWrapping="Wrap"/>

        <!-- Version -->
        <TextBlock
            Grid.Row="1" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.ServerVersionLabel}"/>
        <TextBlock Grid.Row="1" Grid.Column="2" FontSize="16" Text="{Binding CitrixVersion}"
                   TextWrapping="Wrap"/>

        <!-- Service pack -->
        <TextBlock
            Grid.Row="2" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.ServerServicePackLabel}"/>
        <TextBlock Grid.Row="2" Grid.Column="2" FontSize="16" Text="{Binding CitrixServicePack}"
                   TextWrapping="Wrap"/>

        <!-- Edition -->
        <TextBlock
            Grid.Row="3" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.ServerEditionLabel}"/>
        <TextBlock Grid.Row="3" Grid.Column="2" FontSize="16" Text="{Binding CitrixProductEdition}"/>

        <!-- Install location -->
        <TextBlock
            Grid.Row="4" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.ServerInstallLocationLabel}"/>
        <TextBlock
            Grid.Row="4" Grid.Column="2" FontSize="16"
            Text="{Binding CitrixInstallPath}" TextWrapping="Wrap"/>

        <!-- Install date -->
        <TextBlock
            Grid.Row="5" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.ServerInstallDateLabel}"/>
        <TextBlock
            Grid.Row="5" Grid.Column="2" FontSize="16"
            Text="{Binding CitrixInstallDate}" TextWrapping="Wrap"/>
      </Grid>
      <Rectangle Grid.Row="3" Style="{DynamicResource RectangleSeparatorStyle}"/>

      <!-- OS version info. -->
      <Grid Grid.Row="4" Margin="10">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="5"/>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- OS Version -->
        <TextBlock
            Grid.Row="0" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.OsVersionLabel}"/>
        <TextBlock Grid.Row="0" Grid.Column="2" FontSize="16" Text="{Binding OsVersion}"/>

        <!-- Service pack -->
        <TextBlock
            Grid.Row="1" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.OsServicePackLabel}"/>
        <TextBlock Grid.Row="1" Grid.Column="2" FontSize="16" Text="{Binding OsServicePack}"
                   TextWrapping="Wrap"/>

        <!-- Bitness -->
        <TextBlock
            Grid.Row="2" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.OsBitnessLabel}"/>
        <TextBlock Grid.Row="2" Grid.Column="2" FontSize="16" Text="{Binding OsBitness}"/>

      </Grid>
      <Rectangle Grid.Row="5" Style="{DynamicResource RectangleSeparatorStyle}"/>

      <!-- Licensing and zone info -->
      <Grid Grid.Row="6" Margin="10">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="5"/>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- License server -->
        <TextBlock
            Grid.Row="0" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.LicenseServerLabel}"/>
        <TextBlock Grid.Row="0" Grid.Column="2" FontSize="16" Text="{Binding LicenseServerName}"
                   TextWrapping="Wrap"/>

        <!-- License server port -->
        <TextBlock
            Grid.Row="1" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.LicenseServerPortLabel}"/>
        <TextBlock Grid.Row="1" Grid.Column="2" FontSize="16" Text="{Binding LicenseServerPort}"/>

        <!-- Zone name -->
        <TextBlock
            Grid.Row="2" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.ZoneNameLabel}"/>
        <TextBlock Grid.Row="2" Grid.Column="2" FontSize="16" Text="{Binding ZoneName}"
                   TextWrapping="Wrap"/>
        
        <!-- Zone election preference -->
        <TextBlock
            Grid.Row="3" FontSize="16" Foreground="Gray"
            Text="{x:Static prop:Resources.ZoneElectionPrefLabel}"/>
        <TextBlock Grid.Row="3" Grid.Column="2" FontSize="16" Text="{Binding ZoneElectionPreference}"
                   TextWrapping="Wrap"/>

      </Grid>
      <Rectangle Grid.Row="7" Style="{DynamicResource RectangleSeparatorStyle}"/>


    </Grid>
  </ScrollViewer>
</UserControl>
